package element.synt;

import ast.AstItem;
import element.base.Synt;

import java.util.ArrayList;
import java.util.List;

public class ArrayPFix extends Synt {
    @Override
    public List<AstItem> toAsts() {
        List<AstItem> items = new ArrayList<>();
        int dimCount = (getNodes().size() - 1) / 2;

        for (int i = 0; i < dimCount; i++) {
            Exp dimExp = (Exp) getNodes().get(2 * i + 1);
            items.add(dimExp.toAst());
        }

        return items;
    }
}
